<?php
class DataGameTest{
    public $Status;
    public $Position;
    public $Level;
    public $Rank;
    public $Item;
    public $Seat_Trans;  
    public function __construct($status,$pos,$lev,$rank,$item) {
        $this->Status = $status;
        $this->Position = $pos;
        $this->Level = $lev;
        $this->Rank = $rank;
        $this->Item = $item;
        $this->Seat_Trans = 0;
    }    
    public function getSizeBinary(){
        $size = 0;
        $size += 2 ;
        $size += 2 ;
        $size += 2 ;
        $size += 4 ;
        $size += 4 ;
        $size += 4 ; 
        return $size;
    }
    static public function swap($buffer){
        return new DataGameTest(DataUtil::readInt16( $buffer ) ,
                DataUtil::readInt16( $buffer ) , 
                DataUtil::readInt16( $buffer ) , 
                DataUtil::readInt32( $buffer ) , 
                DataUtil::readInt32( $buffer ) 
                );
    }
    public function SetSeatTrans($seat_trans){
        $this->Seat_Trans = $seat_trans;
    }
    public function getBinary(){
        $buffer = ByteBuffer::allocate( $this->getSizeBinary() ) ;
        DataUtil::writeInt16( $buffer ,  $this->Status ) ;
        DataUtil::writeInt16( $buffer ,  $this->Position ) ;
        DataUtil::writeInt16( $buffer ,  $this->Level ) ;
        DataUtil::writeInt32( $buffer ,  $this->Rank ) ;
        DataUtil::writeInt32( $buffer ,  $this->Item ) ;
        DataUtil::writeInt32( $buffer ,  $this->Seat_Trans ) ;
        return $buffer->_array();
    }
}
?>